<!DOCTYPE html>
<html>
  <head>
    <title>Listing 12.11</title>
    <script type="text/javascript" src="../scripts/assert.js"></script>
    <link href="../styles/assert.css" rel="stylesheet" type="text/css">
  </head>
  <body>

    <div style="background-color:darkslateblue">&nbsp;</div> <!--#1-->
    <div style="background-color:#369">&nbsp;</div>
    <div style="background-color:#123456">&nbsp;</div>
    <div style="background-color:rgb(44,88,168)">&nbsp;</div>
    <div style="background-color:rgba(44,88,166,0.5)">&nbsp;</div>
    <div style="background-color:hsl(120,100%,25%)">&nbsp;</div>
    <div style="background-color:hsla(120,100%,25%,0.5)">&nbsp;</div>

    <script type="text/javascript">

      var divs = document.getElementsByTagName('div'); //#2

      for (var n = 0; n < divs.length; n++) {          //#3
        assert(true,divs[n].style.backgroundColor);
      }

    </script>
  </body>
</html>

